import http from '../http/http.js';
import qs from "qs";

export default {
	homeInit(data) {
		return http({
			method: "get",
			url: "/mall/home/init",
		}).catch((e) => {
			return e;
		});
	},
	homeModule(data) {
		return http({
			method: "get",
			url: "/mall/home/module",
		}).catch((e) => {
			return e;
		});
	},
	productHotRecommend() {
		return http({
			method: "get",
			url: "/product/hotRecommend",
		}).catch((e) => {
			return e;
		});
	},
	productHomeRecommend() {
		return http({
			method: "get",
			url: "/product/homeRecommend",
		}).catch((e) => {
			return e;
		});
	},
	cartQuery(userId) {
		return http({
			method: "get",
			params: {
				userId
			},
			url: "/cart/query",
		}).catch((e) => {
			return e;
		});
	},
	hallConfig({ hallType, hallField } = {}) {
		return http({
			method: "get",
			params: {
				hallType,
				hallField
			},
			url: "/hall/config",
		}).catch((e) => {
			return e;
		});
	},
};
